using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace PrimeiraClasse
{
   
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;
        Texture2D imagemAnao;
        Heroi anao;
        SpriteFont texto;
        Boolean exibeFicha = false;


        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
        }

       
        protected override void Initialize()
        {
            IsMouseVisible = true;

            base.Initialize();
        }

  
        protected override void LoadContent()
        {
           
            spriteBatch = new SpriteBatch(GraphicsDevice);
            
            imagemAnao = Content.Load<Texture2D>("enano-bn");
            anao = new Heroi(imagemAnao, new Vector2(100, 100));
            //anao.energia = 1000;
            //anao.nome = "MonDerorth";
            //anao.sorte = 1000;
            //anao.mana = 1000;

            anao.pesonagemEnergia = 30;
            anao.personagemNome = "MonDerorth";
            anao.personagemSorte = 1000;
            anao.personagemMana = 1000;

            texto = Content.Load<SpriteFont>("FonteAnaoFicha");

        }

    
        protected override void UnloadContent()
        {
            
        }


        protected override void Update(GameTime gameTime)
        {
            KeyboardState keyboard = Keyboard.GetState();
            if (keyboard.IsKeyDown(Keys.Space))
            {
                exibeFicha = true;
            }
            else
            {
                exibeFicha = false;
            }


            base.Update(gameTime);
        }

     
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin();
            anao.Draw(gameTime, spriteBatch);
            anao.ExibeFichaAnao(exibeFicha, spriteBatch, texto);
            spriteBatch.End();
                       

            base.Draw(gameTime);
        }
    }
}
